
#ifndef __LABOR_FILESYSTEM_FILE_ENUM_H__
#define __LABOR_FILESYSTEM_FILE_ENUM_H__

#include "../LaborCoreDef.h"
#include "../Mem/stl_dllalloc.h"
#include <vector>
NAMESPACE_LABOR3D_BEGIN

struct LABORCORE_API  xDirEnumItem
{
	std::ds_wstring m_Name;
	std::ds_wstring m_Path;
	std::ds_wstring m_FullName;
	bool            m_isDir;
	int             m_FileSizeLow;
	int             m_FileSizeHi;
};

class LABORCORE_API  IDirEnumListenner
{
public:
	virtual bool onFindFile(xDirEnumItem& item) = 0;
};

class LABORCORE_API  xDirEnum
{
#ifdef _UNIX
	void _enumDir(const wchar_t* wcsDirName, bool recursive);
#endif

public:
	typedef std::vector<IDirEnumListenner*> LISTENNERS;
public:
	xDirEnum();
	~xDirEnum();

	void       enumDir(const wchar_t* dir_name, bool recursive);
	void       addListenner(IDirEnumListenner* pListner);
	void       removeListenner(IDirEnumListenner* pListner);
protected:
	LISTENNERS m_vListners;
	bool       __findFile(xDirEnumItem& item);

};


NAMESPACE_LABOR3D_END

#endif
